const {
	defineConfig
} = require('@vue/cli-service')
module.exports = defineConfig({
	transpileDependencies: true,
	devServer: {
		proxy: {

			"/enlib-api": {
				target: "https://ys.endata.cn",
				changeOrigin: true,
				onProxyReq(req) { //添加请求头
					req.setHeader("Referer", "https://ys.endata.cn")
				}
			},
			// https://gw.newrank.cn/api/ixigua/nr/app/ixigua/rank/ability
			// http://dida100.com:8888/api/yp/orderlist
			"/yp": {
				target: "http://dida100.com:8888",
				changeOrigin: true,
				onProxyReq(req) { //添加请求头
					req.setHeader(
						"Referer", "http://dida100.com:8888"
					)
				},
				pathRewrite: {
					"/yp": "/api/yp"
				}
			},
			"/api": {
				target: "http://dida100.com:8888",
				changeOrigin: true,
				onProxyReq(req) { //添加请求头
					req.setHeader(
						"Referer", "http://dida100.com:8888"
					)
				}
			},
			"/upimg": {
				// http://localhost:8080/api/yp/upimg?current=1&size=10&album=1
				target: "http://dida100.com:8888",
				changeOrigin: true,
				onProxyReq(req) { //添加请求头
					req.setHeader(
						"Referer", "http://dida100.com:8888"
					)
				},
				pathRewrite: {
					"/upimg": "/api/yp/upimg"
				}
			}

		}
	}
})